package registnet.records.source;

import registnet.records.College;

public class CollegeSource {

	private String collegeCode;
	private College college;
	
	
	/**
	 * Default constructor
	 * 
	 * @param collegeCode - The code assigned to a college
	 */
	public CollegeSource(String collegeCode){
		this.collegeCode = collegeCode;
		this.load();
	}
	
	
	/**
	 * Loads data from source
	 */
	public void load(){
		try{
			registnet.dao.College DAOCollege = new registnet.dao.CollegePeer().getCollege(this.collegeCode);
			this.college = new College(this.collegeCode);
			this.college.setCollegeName(DAOCollege.getCollegeName());
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	
	
	/**
	 * Gets the college
	 * 
	 * @return	The college
	 */
	public College getCollege(){
		return this.college;
	}
	
}
